<?php
session_start();
require('settings.php');
require('dbConn.php');
$user_session = explode("_", $_SESSION['user']);
$user_id = $user_session[0];

if(isset($_SESSION['user'])){

	$sql = "SELECT verification FROM users WHERE id = '".$user_id."'";
	$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
	$rs=mysql_fetch_assoc($query);


if($rs['verification'] == strtoupper($_GET['code'])){

	$sql = "UPDATE users SET mobile_verified = '1', verification = '' WHERE id = '".$user_id."'";
	$query=mysql_query( $sql ) or die ("Error in query: $sql . " . mysql_error());
	
	echo '1';

}

else{

	echo '0';

}

}

?>